package com.lagou.controller.mockdata;

import com.lagou.entity.Job;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class Jobs {
    public static List<Job> jobs = new ArrayList<>();
    public static HashMap<Integer, Job> jobMap = new HashMap<>();

    /**
     * 伪数据初始化
     */
    static {

        String[] cities = {"北京", "上海", "广州", "深圳", "杭州"};
        String[] titles = {"C++", "Java", "Golang", "Node.js", "Python"};
        String[] salaries = {"10K-15K", "15K-20K", "20K-25K", "25K-30K"};


        for (int i = 1000; i <= 9999; i++) {
            Job job = new Job();

            job.setId(i);
            job.setLocation(cities[(int)(cities.length * Math.random())]);
            job.setTitle(titles[(int)(titles.length * Math.random())] + "工程师");
            job.setDescription("1、计算机相关专业专科及以上学历，3年工作经验以上；\n" +
                    "\n" +
                    "2、java基础扎实，熟悉数据结构，及常用的设计模式；\n" +
                    "\n" +
                    "3、熟悉springboot ,springcloud，mybatis；\n" +
                    "\n" +
                    "4、熟练掌握mysql、mongodb等数据库；\n" +
                    "\n" +
                    "5、熟悉redis、kafka、nginx、docker等，熟悉常用的linux命令；\n" +
                    "\n" +
                    "6、责任心强，做事细心、具备良好的团队合作精神和承受压力的能力；");

            job.setSalary(salaries[(int)(salaries.length * Math.random())]);

            jobs.add(job);
            jobMap.put(i, job);
        }
    }
}
